﻿using System;
using System.Threading.Tasks;

namespace LunchLearn.WebApi.Infrastructure.Notifications
{
    public class NotificationBridge : INotificationBridge
    {
        public void SendNotification(Notification notification)
        {
            if (MessageReceived != null)
            {
                Task.Factory.StartNew(() => MessageReceived(this, new NotificationBridgeEventArgs(notification)));
            }
        }

        public event EventHandler<NotificationBridgeEventArgs> MessageReceived;
    }
}